package com.swanclouds.redfish.common.redfish;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.swanclouds.model.managers.Oem.BMC.UpdateKvmService;
import com.swanclouds.model.managers.builder.BMC.UpdateKvmServiceBuilder;

import java.util.Map;

/**
 * @author 李文强
 * description
 */

public class KVM implements UpdateKvmService {
    /**
     * 单端口状态
     * true：不加密模式访问
     * false：加密模式访问
     * 当SingleportStatus为true时，EncryptionEnabled为false
     */
    @JsonProperty("SingleportStatus")
    private Boolean SinglePortStatus;

    /**
     * 服务器监控OFF功能状态
     * true：监控
     * false：不监控
     */
    @JsonProperty("MonitorHostOffEnabled")
    private Boolean monitorHostOffEnabled;

    /**
     * 当KVM启动时自动OFF服务器监控
     * true：不再监控
     * false：监控
     */
    @JsonProperty("AutoOffHostMonitor")
    private Boolean autoOffHostMonitor;

    /**
     * 是否加密
     * true：加密
     * false：不加密
     */
    @JsonProperty("EncryptionEnabled")
    private Boolean encryptionEnabled;

    /**
     * 鼠标模式，包括：
     * absolute：绝对位置模式（windows）
     * relative：相对位置模式（linux）
     * other：其它模式
     */
    @JsonProperty("MouseMode")
    private String  mouseMode;

    /**
     *KVM窗口自适应纵横比 参数为1时不会报错
     */
    @JsonProperty("AspectRatio")
    private Integer aspectRatio;

    /**
     * KVM重连间隔，单位为秒
     * 仅当ReconnectEnabled为true时有效
     */
    @JsonProperty("RetryInterval")
    private Integer retryInterval;

    /**
     * KVM重连次数
     * 仅当ReconnectEnabled为true时有效
     */
    @JsonProperty("RetryCount")
    private Integer retryCount;
    /**
     * 键盘语言
     * “AD”：自动检测
     */
    @JsonProperty("KeyboardLayout")
    private String keyboardLayout;

    /**
     * KVM会话类型
     * “Shared”：共享 “Private”：独占
     */
    @JsonProperty("ActivatedSessionsType")
    private String activatedSessionsType;


    public Boolean getSingleportStatus() {
        return SinglePortStatus;
    }

    public void setSingleportStatus(Boolean singleportStatus) {
        this.SinglePortStatus = singleportStatus;
    }

    public Boolean getMonitorHostOffEnabled() {
        return monitorHostOffEnabled;
    }

    public void setMonitorHostOffEnabled(Boolean monitorHostOffEnabled) {
        this.monitorHostOffEnabled = monitorHostOffEnabled;
    }

    public Boolean getAutoOffHostMonitor() {
        return autoOffHostMonitor;
    }

    @Override
    public Boolean getLicenseStatus() {
        return null;
    }

    @Override
    public Boolean getServiceEnabled() {
        return null;
    }

    public void setAutoOffHostMonitor(Boolean autoOffHostMonitor) {
        this.autoOffHostMonitor = autoOffHostMonitor;
    }

    public Boolean getEncryptionEnabled() {
        return encryptionEnabled;
    }

    public void setEncryptionEnabled(Boolean encryptionEnabled) {
        this.encryptionEnabled = encryptionEnabled;
    }

    public String getMouseMode() {
        return mouseMode;
    }

    public void setMouseMode(String mouseMode) {
        this.mouseMode = mouseMode;
    }

    public Integer getAspectRatio() {
        return aspectRatio;
    }

    public void setAspectRatio(Integer aspectRatio) {
        this.aspectRatio = aspectRatio;
    }

    public Integer getRetryInterval() {
        return retryInterval;
    }

    public void setRetryInterval(Integer retryInterval) {
        this.retryInterval = retryInterval;
    }

    public Integer getRetryCount() {
        return retryCount;
    }

    public void setRetryCount(Integer retryCount) {
        this.retryCount = retryCount;
    }

    @Override
    public String getKeyboardLayout() {
        return keyboardLayout;
    }

    @Override
    public String getActivatedSessionsType() {
        return activatedSessionsType;
    }

    @Override
    public String getDescription() {
        return null;
    }

    @Override
    public Map<String, Object> getActions() {
        return null;
    }

    @Override
    public Integer getKvmPort() {
        return null;
    }

    @Override
    public UpdateKvmServiceBuilder toBuilder() {
        return new UpdateKvmServiceConterteBuilder();
    }

    public static UpdateKvmServiceBuilder builder() {
        return new KVM().toBuilder();
    }

    public static class UpdateKvmServiceConterteBuilder implements UpdateKvmServiceBuilder{

        KVM  m;

        UpdateKvmServiceConterteBuilder(){
            this(new KVM());
        }

        UpdateKvmServiceConterteBuilder(KVM m){
            this.m = m;
        }

        @Override
        public UpdateKvmService build() {
            return m;
        }

        @Override
        public UpdateKvmServiceBuilder from(UpdateKvmService in) {
            m = (KVM) in;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder SingleportStatus(Boolean singlePortStatus) {
            m.SinglePortStatus = singlePortStatus;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder EncryptionEnabled(Boolean encryptionEnabled) {
            m.encryptionEnabled = encryptionEnabled;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder KeyboardLayout(String keyboardLayout) {
            m.keyboardLayout = keyboardLayout;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder RetryCount(Integer retryCount) {
            m.retryCount = retryCount;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder RetryInterval(Integer retryInterval) {
            m.retryInterval = retryInterval;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder MonitorHostOffEnabled(Boolean monitorHostOffEnabled) {
            m.monitorHostOffEnabled = monitorHostOffEnabled;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder AutoOffHostMonitor(Boolean autoOffHostMonitor) {
            m.autoOffHostMonitor = autoOffHostMonitor;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder AspectRatio(Integer aspectRatio) {
            m.aspectRatio = aspectRatio;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder MouseMode(String mouseMode) {
            m.mouseMode = mouseMode;
            return this;
        }

        @Override
        public UpdateKvmServiceBuilder ActivatedSessionsType(String activatedSessionsType) {
            m.activatedSessionsType = activatedSessionsType;
            return this;
        }
    }



    @Override
    public String getDataId() {
        return null;
    }

    @Override
    public String getContext() {
        return null;
    }

    @Override
    public String getType() {
        return null;
    }

    @Override
    public String getId() {
        return null;
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public String toString() {
        /*ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }*/
        return "{" +
                "SinglePortStatus=" + SinglePortStatus +
                ", monitorHostOffEnabled=" + monitorHostOffEnabled +
                ", autoOffHostMonitor=" + autoOffHostMonitor +
                ", encryptionEnabled=" + encryptionEnabled +
                ", mouseMode='" + mouseMode + '\'' +
                ", aspectRatio=" + aspectRatio +
                ", retryInterval=" + retryInterval +
                ", retryCount=" + retryCount +
                ", keyboardLayout='" + keyboardLayout + '\'' +
                ", activatedSessionsType='" + activatedSessionsType + '\'' +
                '}';
    }
}
